<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="wangyuguo">
		<title>操作员管理</title>
		<script type="text/javascript" src="../script/common.js"></script>
		 
		<script type="text/javascript">
	var org = Common.cOrg();		//当前单位	
	var qt = {};					//数据表格对象
	var qt1= {}						//回收卡表格对象
	var inited = false,Page;				//初始化标志	
	
	
		function load(){
			Page = {};//页面元素Page
			Page.form = $("searchForm");
			//	Eui.initBeginDateInput("beginTimeTd","起始日期","searchForm","startDate","endDate","_pastDate");
			//Eui.initEndDateInput("endTimeTd","结束日期","searchForm","startDate","endDate","_pastDate");
			ListPage.initDateSelects();
			Eui.initCompareInput(Page.form.id,"minAmountTd","maxAmountTd",
				"最小额(元)","最大额(元)","minMoney","maxMoney","nonNegativeAmount","ge",false);
			Common.initDict(searchForm.giftId,"gift_item","全 部");
			
			searchForm.orgID.value = org.id;
			searchForm.organization.value = org.name;
			searchForm.orgLevel.value = org.orgLevel;
			createTable()
			}

			/**查询部分**/
			//创建queryTable
			function createTable() {
				var columns = []
				columns[0] = {type:"checkbox"}
				//columns[1] = {render:nameFunc}
				//columns[8] = {title:"操作",width:"15",render:operFunc,align:"center",order:false}
				qt = new QueryTable("clear_cash_list", "searchForm", "datalist", columns, {
					exportable:true,
					//columnsConf:false,
					displayColumns:[0,1,2,3,4,5,6,8,9],
					//forceFit:true,
					buttons:[
						{value:"删 除",actions:onDelete}
					]
				});
			}
			
			//操作
			function operFunc(v, r) {
				return "<a href='#' onclick=\"onEdit(" + r[0] + ");return false;\">编辑</a>";//+" <a href=# onclick=\"resetPswd('" + r[3] + "','" + r[1] + "');return false;\">重置密码</a>";
			}
			
			//数据删除方法
			function onDelete() {
				var ids = qt.getBoxValue();
				Eui.onDel("expandCardTxService.deletecashtrades",ids, "交易", null, function() {
					qt.showTable();
				});
			}
			
			//编辑操作员数据
			function onEdit(id) {
				switchPage("editview");
				editcashtrade("editcashtrade",id);
			}
		
		function onSave(){
				if (!checkForm(operatorForm)) return;
				var cashTrade = Common.getValues(operatorForm);
				try{
					var v = DWR.syncCall("expandCardTxService.saveCashtrade", cashTrade)
					showInformation("现金交易保存成功")
					qt.showTable();
				}catch(e){showError(e.description);return;}
			}
		
	
		//选择机构方法
			function searchSelOrg(){
				SystemMgnt.selOrg(function(sorg) {
						searchForm.organization.value = sorg.name;
						searchForm.orgID.value = sorg.id;
					});
			}
			
	function editcashtrade(divId,id,options){
		
		if (!options) options = {};
		Rpc.loadPage(divId,"/trade/cashtrade_div.html")
				
		//Common.initDict(operatorForm.gender, "gender", "－－");		//初始化性别(明细)
	   
	
		var orglink = $("operator_sel_org");
		if (orglink)
			orglink.onclick = function(){
				SystemMgnt.selOrg(setDetOrg,{funcType : Constants.SELORG_ALL})
			}
		var result;
		if (id) {
			result = DWR.syncCall("expandCardTxService.getCashTradeById",id);
		}
		var cashtrade = {};
		
		if (result){
			cashtrade = result.CashTrade;
			cashtrade.orgname = result.orgName;
			operatorForm.reset();
			//Common.setValues(operatorForm, cashtrade);
			Common.setValue(operatorForm.organization, cashtrade.orgname);
		}else{
			operatorForm.reset();
			setDetOrg(Common.cOrg());
		}
			
		if (options.isInfo){
			$("operatorForm_invalidTime").style.display = "none";
			$("operator_sel_org").style.display = "none";
		}
		SystemMgnt.initData(operatorForm,options.initData);
}
			
		</script>
	</head>
	<body onload="load()">
		<!--页面导航-->
		<div class="nav">
			<div id="nav">&nbsp;</div>
		</div>
	
		<!--查询&列表-->
		<div id="listview">
			<!--查询form-->
			<div class="searchForm">
				<form id="searchForm" name="searchForm">
					<input type="hidden" name="orgID"/>
					<input type="hidden" name="orgLevel"/>
					<table cellSpacing="0" cellPadding="4" width="100%" border="0" class="label5">
						<tr>
							
							<td>
								<label>受理机构&nbsp;&nbsp;</label>
								<input type="text" name="organization" maxlength="20" readonly class="readonly"><a class="orga" href="#" onclick="searchSelOrg();">&nbsp;&nbsp;</a>
							</td>
							<td class="label5"><label>商品名称</label> <select name="giftId"></select></td>
						
							<td>
								<label>操作员编号</label>
								<input type="text" name="operatorId" onblur="checkV(this,'number')" maxlength="10">
							</td>
							
						</tr>
						<tr>
							<td id="beginDateTd"></td>
							<td id="endDateTd"></td>
							
						</tr>
						<tr>
							<td id="minAmountTd"></td>
							<td id="maxAmountTd"></td>
							<td><button type="button" onclick="qt.showTable()">查 询</button></td>

						</tr>
					</table>
				</form>
			</div>
		
			<div id="datalist"></div>
		</div>
	
	
		<!--增加/编辑明细页面部分-->
		<div id="editview" style="display:none;">
			<div id="editcashtrade">
				
			</div>
			<p>
				<button type="button" onclick="onSave();">保 存</button>
				<button type="button" onclick="switchPage('listview');">返 回</button>
			</p>
		</div>
		
		<!--操作员明细静态页面部分-->
		<div id="detview" style="display:none;">
			<div id="operatordet">
			</div>
			<p>
				<button type="button" onclick="switchPage('listview');">返 回</button>
			</p>
		</div>
	

	</body>
</html>